<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateRbacRouteTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('rbac_route', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name','60')->comment('路由名称');
            $table->string('label',60)->comment('路由别名');
            $table->unsignedInteger('pid',false)->default(0)->comment('父类id');
            $table->string('guard_name','15')->default('web')->comment('认证名称');
            $table->string('type',25)->default('adminfront')->comment('路由类型');
            $table->string('method','15')->nullable()->default('GET')->comment('method');
            $table->timestamps();
            $table->softDeletes();
            $table->engine="InnoDb";
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('rbac_route');
    }
}
